<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta name="author" content="wangzhichao">
	<TITLE>手工调整白卡库存</TITLE>
	<script language="javascript" src="../script/common.js" type="text/javascript"></script>
	<script language="javascript" type="text/javascript">
		//全局变量
		var org = Common.cOrg();	//当前单位	
		var qt = {};				//数据表格对象
	
		var billId;
		var billType;
		//页面控件初始化
		function load(){
			Eui.showNavigation();
			setPages(["detview","selectdetview","printview"])
		
			Common.initDict(personform.subType,"blankcardbill_subtype","请选择");		//初始化调整类型
			//var adjustSubTypes = Common.getSubsetItems(CardBillSubType.CATEGORY, [CardBillSubType.ADJUST_CHECK, CardBillSubType.ADJUST_LOST]);
		}
		//数据保存
		function onSave(){
			if(!checkForm(personform))return;
			if(!(showQuestion("您确认保存?"))){
			  	return;
		 	}
			var listForm = Common.getValues(personform);
			DWR.call("blankCardStoreService.adjustBlankCardInventory",listForm,function(v){
				showInformation("白卡库存调整成功!");
				billId = v.id;
				billType = CardBillType.ADJUST;
				requestframe.document.location.href = "print_blank_bill.html";
				switchPage("printview");
				//CardStore.showBlankBill('selectdetview',v.id);
			},{disCtrl:$('saveBtn')});
		}
		//选择卡片规格
		function selSpec(){
			var v = openDialogFrame("/store/sel_white_list.html",'选择卡片规格',464,700)
		    if (v){
				personform.cardSpec.value=v.id;
				personform.cardSpecs.value = v.name;
				
			}
		}
		
	 	function resetFunc(){
		 	personform.reset();
		   	switchPage('detview');
		}
		//打印方法
		function printlnBlankBill(){
			billType = CardBillType.ADJUST;
			requestframe.document.location.href = "print_blank_bill.html";
			switchPage("printview");
			//var v = openDialogFrame("/store/print_blank_bill.html?billType="+CardBillType.ADJUST+"&billId="+billId,"打印单据",450,700);
		}
		//返回方法
		function closePrintDialog(){
			personform.reset();
			switchPage("detview");
		}
	</script>
</head>
<body onload="load()">
	<!--页面导航-->
	<div class="nav"><div id="nav">&nbsp;</div></div>
	<!--(新增)页面部分-->
	<div id="detview">
		<form id="personform" name="personform">
		<input type="hidden" name="id">
		<input type="hidden" name="cardSpec">
			<div class="form">
	  			<div class="formTitle">白卡库存调整</div>
				<table cellSpacing=0 cellPadding=4 width="100%" border=0>
					<tr>
						<td><label>卡片规格</label> <input type="text" name="cardSpecs" readonly class="readonly" onblur="checkV(this,'',true)" ><a class=orga title="选择卡片规格" href="javascript:void(0)" onclick="selSpec()">&nbsp;&nbsp;</a><font class="des">*</font></td>	 
		      		 	<td><label>数&nbsp;&nbsp;&nbsp;&nbsp;量</label> <input type="text" name="amount" onblur="checkV(this,'positiveInt',true)" maxlength="9"><font class="des">*</font></td>
					</tr>
					<tr>
						 <td><label>调整类型</label> <select name="subType" onblur="checkV(this,'',true)"><option></option></select><font class="des">*</font></td>
						 <td><label>备&nbsp;&nbsp;&nbsp;&nbsp;注</label> <input type="text" name="description" onblur="checkV(this,'',true)" maxlength="32"><font class="des">*</font></td>
					</tr>		
				</table>
			</div>
			<p><button type="button" id="saveBtn" name="saveBtn" onclick='onSave()' >保    存</button></p>
		</form>
	</div>
	<!--明细静态页面部分-->
	<div id="selectdetview" style="display:none;" align="center"></div>
	
	<div class="printview" id="printview" style='display:none;'>
		<iframe id="requestframe" name="requestframe" style="width:100%;height:90%;overflow:auto;" frameborder=0 src=""></iframe>
	</div>
</body>
</html>
